package com.tech.distribute_id;

import org.springframework.stereotype.Component;

import java.util.UUID;

/**
 * @author litianlin
 * @date 2023/11/23 18:13
 * @description: UUID方案
 */
@Component
public class Uuid extends AbstractDistributeIdStrategy{
    public static void main(String[] args) {
        String disId = UUID.randomUUID().toString();
        System.out.println(disId);

    }


    @Override
    public StrategyTypeEnum getStrategyType() {
        return StrategyTypeEnum.UUID;
    }

    @Override
    public String getDistributeId() throws Exception {
        return UUID.randomUUID().toString();
    }
}
